import request from '@/config/axios'

// 资源分类 VO
export interface ResourceClassifyVO {
  id: number // 主键
  name: string // 名称
  alias: string // 别名
}

// 资源分类 API
export const ResourceClassifyApi = {
  // 查询资源分类分页
  getResourceClassifyList: async (): Promise<any[]> => {
    return await request.get({ url: `/system/resource-classify/list` })
  },
  // 查询资源分类分页
  getResourceClassifyPage: async (params: any) => {
    return await request.get({ url: `/system/resource-classify/page`, params })
  },

  // 查询资源分类详情
  getResourceClassify: async (id: number) => {
    return await request.get({ url: `/system/resource-classify/get?id=` + id })
  },

  // 新增资源分类
  createResourceClassify: async (data: ResourceClassifyVO) => {
    return await request.post({ url: `/system/resource-classify/create`, data })
  },

  // 修改资源分类
  updateResourceClassify: async (data: ResourceClassifyVO) => {
    return await request.put({ url: `/system/resource-classify/update`, data })
  },

  // 删除资源分类
  deleteResourceClassify: async (id: number) => {
    return await request.delete({ url: `/system/resource-classify/delete?id=` + id })
  },

  // 删除文件
  deleteResourceClassifys: (ids: number[]) => {
    return request.delete({ url: `/system/resource-classify/deletes?ids=` + ids })
  },

  // 导出资源分类 Excel
  exportResourceClassify: async (params) => {
    return await request.download({ url: `/system/resource-classify/export-excel`, params })
  }
}
